<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title><?php echo $ci->config->item('app_title')?></title>
	
	<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/grocery_crud/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/grocery_crud/css/ui/simple/jquery-ui-1.10.1.custom.min.css">
	
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery-1.10.2.min.js"></script>

	<!-- jScrollPane -->


	<!--  -->

	<script type="text/javascript">
	$(document).ready(function(){
		// $('#AppLoad').ajaxStart(function(){
		// 	console.log('ajax_start');
		// 	console.log(arguments);
		// }).ajaxComplete(function(){
		// 	console.log('ajax_complete');
		// 	console.log(arguments);
		// });
	});
	</script>
 	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/jquery.layout-latest.js"></script>

	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.widget.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.accordion.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.button.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.position.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.dialog.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/grocery_crud/css/app.css">


<style type="text/css">
body{
	font-family: arial,​sans-serif;
	font-size: 12px;
	background: transparent;
}
.ui-widget{
	font-size: 12px;
}
.menu-bar{
	list-style: none;
	padding: 0;
	margin: 0;	
}
.userinfo a{
	color: brown;
	font-weight: bold;
}
ul.menu-bar > li > a {
    display: block;
    font-weight: bold;
    margin: 7px 0 0 -1px;
    text-decoration: none;
    color: #004369;
}


ul.menu-bar > li > a:hover,
ul.menu-bar > li > a.active {
    display: block;
    font-weight: bold;
 /*  text-decoration: underline;*/
   color: brown;
}
.ui-layout-south{
	/*width: 250px !important;*/
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	background: url() !important;

}
.ui-layout-north{
	background: transparent url(<?php echo base_url()?>assets/images/bgh-tile.png) repeat-x top left !important; 
	overflow: hidden !important;
	border: none !important;
/*	height: auto !important;*/
}

p.footer-txt{
	margin: 0;
	padding: .5em;
	text-align: right;
}
.header-info{
	/*height: 100px;
	background: #dedede;*/

}
.ui-layout-toggler{
	display: #cecece !important;
}
.ui-layout-center{
/*	padding: 0 0 10px 0 !important;*/
	padding:1px 0px 0px 0px !important;
	background: #deefff; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url();
background: -moz-linear-gradient(-45deg,  #deefff 0%, #98bede 100%) !important; /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#deefff), color-stop(100%,#98bede)) !important; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg,  #deefff 0%,#98bede 100%) !important; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg,  #deefff 0%,#98bede 100%) !important; /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg,  #deefff 0%,#98bede 100%) !important; /* IE10+ */
background: linear-gradient(135deg,  #deefff 0%,#98bede 100%) !important; /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#deefff', endColorstr='#98bede',GradientType=1 ) !important; /* IE6-8 fallback on horizontal gradient */
/*overflow: hidden !important;*/
}
.ui-layout-west{
	background: #8AEFFE  url(<?php echo base_url()?>assets/images/bg-west.png) no-repeat left 125px  !important;
	padding: 0 0 0 15px;
	/*margin: 76px 0 0 !important;*/
}
.ui-layout-resizer.ui-layout-resizer-south,
.ui-layout-resizer.ui-layout-resizer-north,
.ui-layout-resizer.ui-layout-resizer-east{
	display: none !important;
}
a.homepage-ln{
	 display: block;
    position: absolute;
    z-index: 1;
    margin: -1px 0 0 0;
    width: 170px;
    overflow: hidden;
}
a.homepage-ln img{
	border: none ;
}
a.homepage-ln span{
	display: none;
}
h3.htitle{
	margin:0;
	padding: 25px;
}
a.um-chg-pwd {
    float: right;
}

div.bgTop{
	background: transparent url(<?php echo base_url() ?>assets/images/bg-h.png) no-repeat top right;
	height: 71px;
    left: 170px;
    position: absolute;
    top: -1px;
    width: 420px;
    z-index: 1;
}
span.Admin{color: red}
span.Cabang{color: green}
span.Data.Entri{color: orange}
</style>
<script type="text/javascript">
// window.ACTIVE_REQUEST = {
// 	hash:''
// };
<?php
// $grp = array(
// 	'Admin'	=> 'ADM',
// 	'Cabang'=> 'CBN',
// 	'Data Entri' => 'DE'
// )
?>
function setContent (sec,com,el,callback) {
	var url = '<?php echo base_url()?>' + sec + '/' + com;
	//var hash = '#/' + sec + '/' + com;
	$('#iframeContent').prop('src',url).load(function(){
		if(typeof callback == 'function')
		{
			callback(url);
		}
		try
		{
			$('#iframeContent').get(0).contentWindow.SetGridMainIcon($(el).find('>i').prop('class'));
		//	console.log($('#iframeContent').prop('src'));
		}
		catch(e){}
	});
	
	// var cls = 'com-'+sec+'-'+com;
	// if( !$(el).hasClass(cls) )
	// 	$(el).addClass(cls);

	// document.location.hash = hash;

	// window.ACTIVE_REQUEST.hash = new String(hash);
	
}
function checkHash(){

	// var currentHash = document.location.hash;
	
	// if(window.ACTIVE_REQUEST.hash != currentHash){
	// 	//EXTRACT HASH
	// 	var hashes = currentHash.split('/');
	// 	var sec = hashes[1];
	// 	var com = hashes[2];
	// 	var el  = $('.com-'+sec+'-'+com);
		
	// 	//setContent(sec,com,el);

	// 	console.log(hashes);
	// }
	// setTimeout(function(){
	// 	checkHash();
	// },500)
}

function base_url (){
	return "<?php echo base_url()?>";
}



 $(document).ready(function () {
 	var loggedIn = !($('#AppLoad').text().replace(/\s/,'') == 'Welcome'); 
	// INIT LAYOUT
	var west_not_loggedIn = {initClosed:true,togglerLength_closed:0,size:250};
	var west_loggedIn = {size:169};
	if(loggedIn){
		$('.userMenu').show().css({
			display: 'block',
			padding: '21px 9px 0 51px',
			position: 'absolute',
			right: '0',
			top: '0'
		});
		$('.userMenu button').css({padding:'4px',cursor:'pointer'}).addClass('ui-state-default ui-corner-all')

	}
	var westConfig = loggedIn ? west_loggedIn : west_not_loggedIn;
	$('body').layout({ 
		applyDemoStyles: false, 
		east:{initClosed:true,togglerLength_closed:0},
		north:{size:70,initClosed:0,togglerLength_open:0},
		south:{size:0,initClosed:1,togglerLength_open:0},
		west:westConfig,
		east__initHidden: true ,
		west__resizable: false,
		east__resizable: false,
		north__resizable: false,
		south__resizable: false,
	});

	// INIT SIDEBAR MENU
	$( "#accordion" ).accordion({
		heightStyle: "content",
		autoHeight: false,
        clearStyle: true, 
	});

	// DO NAVIGATION HISTORY
	//checkHash();

	$('body').ajaxComplete(function(){
		//console.log(this.arguments);
	});
	// TRIPLE DES
	// var encrypted = CryptoJS.DES.encrypt("Message", "123");
	// console.log(encrypted);
 //    var decrypted = CryptoJS.DES.decrypt(encrypted, "123");
 //    console.log(decrypted);

 	setTimeout(function(){
 		// $('.ui-layout-west').jScrollPane();
 		// $('.ui-layout-center').jScrollPane();
 	},1000);

 	$('a.um-chg-pwd').click(function(){

			var url = $(this).prop('href');
   			var dlg = $('<div id="upwdlg"></div>');
   			var cnt = '<div class="pengguna-password">'+
				'<div>'+
					'<label style="display: block; width: 87px; float: left; line-height: 22px;">Password :</label>'+
					'<input style="float:left;margin-top:1px;" type="password" name="pengguna_password"/>' +
				'</div><div><input  style="float:left;cursor:pointer;margin-left:2px" type="button" value="Set" class="cmd_set_passwd"/></div>' +
			'</div>';
			var dlg_title = 'Ubah Password  ';
			try{
			dlg.html(cnt).dialog({
				modal:true,
				title:dlg_title,
				width:328,
				height:80,
				close:function(){
					dlg.remove();
				}
			});
			
			dlg.find('input.cmd_set_passwd').click(function(){
				var new_passwd = dlg.find('input[name=pengguna_password]').val();
				if(!new_passwd.length){
					alert('Mohon lengkapi data Anda !')
					return;
				}

				
				$.post(url,{passwd:new_passwd},function(o){
					alert(o);
					dlg.dialog('close')	;
				});	
			})
			dlg.find('input[name=pengguna_password]').keydown(function(e){
				if(e.keyCode==13){
					dlg.find('input.cmd_set_passwd').click();
				}
			});
			dlg.dialog('open');
   			}
   			catch(e){
   				console.log(e)
   			}
			return false;
    	});

	$('ul.menu-bar > li > a').click(function(){
		$('ul.menu-bar > li > a').removeClass('active');
		$(this).addClass('active');
	})
});
</script>
</head>
<body>
<a class="homepage-ln">
	<img src="<?php echo base_url() ?>assets/images/bg-h.png" alt="<?php echo $ci->config->item('app_title')?>"/>	
	 <span><?php echo $ci->config->item('app_title')?></span> 
</a>
<div class="bgTop">
</div>
<div class="ui-layout-center">
<div class="header-info">

</div>	
	<iframe style="border:none" frameBorder="0" allowTransparancy="true" width="100%" height="100%" src="<?php echo base_url()?>welcome/greeting" id="iframeContent">
	</iframe>
</div>

<div class="ui-layout-north">	
<h3 class="htitle">
</h3>
<div class="userMenu">
<div class="userinfo" id="userInfo">
	<i class="fa fa-user"></i>&nbsp;<?php echo $this->LoginInfo->GetUserInfo('nama_lengkap')?> | <?php echo strtoupper($this->LoginInfo->GetUserInfo('tipe_admin'))?> | 
	<a class="pengguna_config " title="Logout" href="<?php echo base_url()?>session/logout/<?php echo $this->LoginInfo->GetUserInfo('id_pengguna')?>">Logout</a>

</div>

<!-- <button onclick="$('#AppLoad').text('Welcome');setTimeout(function(){setContent('session','logout',this,function(url){console.log(url);window.location.reload();});},300);" class="exit" id="exitButton"><i class="fa fa-undo"></i>&nbsp;Keluar</button>
 -->


</div>
</div>
<style type="text/css">
	.status-bar{
		color: #008000;
	    float: left;
	    margin: 3px 0 0 1em;
	    padding: 2px;
	    width: 243px;
	}
	.footer-txt{
		float: right;
		width: 80%;
		text-align: left;
	}
	.userMenu{
		display: none;
	}
	.g-output{
		width: 95% !important;
	}
</style>
<div class="ui-layout-south">
	<p class="status-bar" id="AppLoad">Welcome <?php echo $this->LoginInfo->GetUserInfo('nama_lengkap')?></p>
	<p class="footer-txt">Copyright &copy; <?php echo date('Y');?><b> <?php echo $ci->config->item('app_company')?></b></p>
	<div style="clear:both"></div>
</div>
<div class="ui-layout-east">&nbsp;</div>
<div class="ui-layout-west">
<!-- ACCORDION -->
<div id="accordion-ls">
	<h3><i class="fa fa-reorder"></i>&nbsp;</h3>
	<div>
		<ul class="menu-bar">
			<li><a href="javascript:;" onclick="setContent('welcome','greeting',this)"><i class="fa fa-home"></i>&nbsp;Beranda</a></li>
			<!-- ADMIN MENU -->
			<?php if($this->LoginInfo->Is('Lurah')):?>
			<li><h3><i class="fa fa-gear"></i>&nbsp;PENGATURAN&nbsp;</h3></li>
			<li class="ch"><a href="javascript:;" onclick="setContent('master','group_pengguna',this)"><i class="fa fa-users"></i>&nbsp;Group Pengguna</a></li>
			<li class="ch"><a href="javascript:;" onclick="setContent('master','pengguna',this)"><i class="fa fa-user"></i>&nbsp;Pengguna</a></li>
			<li><h3><i class="fa fa-database"></i>&nbsp;MASTER&nbsp;</h3></li>
			<li class="ch"><a href="javascript:;" onclick="setContent('master','jabatan',this)"><i class="fa fa-sitemap"></i>&nbsp;Jabatan</a></li>
			<li class="ch"><a href="javascript:;" onclick="setContent('master','golongan',this)"><i class="fa fa-mortar-board"></i>&nbsp;Golongan</a></li>
			<li class="ch"><a href="javascript:;" onclick="setContent('master','pegawai',this)"><i class="fa fa-child"></i>&nbsp;Pegawai</a></li>
			<li>&nbsp;</li>			
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya/',this)"><i class="fa fa-tasks"></i>&nbsp;Aktifitas Lurah</a></li>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_pegawai/set_mode/Pegawai',this)"><i class="fa fa-tasks"></i>&nbsp;Aktifitas Pegawai</a></li>
			<li class="indent"><a href="javascript:;" onclick="setContent('master','laporan',this)"><i class="fa fa-bar-chart-o"></i>&nbsp;<span>Laporan Aktifitas Pegawai</span></a></li>
			<?php endif;?>
			<!-- END OF ADMIN MENU -->

			<!-- LURAH -->
			
			<!-- END OF LURAH -->

			<!-- Sekretaris -->
			<?php if($this->LoginInfo->Is('Sekretaris')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_pegawai/set_mode/Pegawai',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Pegawai</a></li>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya/',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Sekretaris</a></li>
			<?php endif;?>
			<!-- END OF Sekretaris -->

			<!-- Seksi Pemerintahan -->
			<?php if($this->LoginInfo->Is('Seksi Pemerintahan')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Seksi Pemerintahan</a></li>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_pegawai/set_mode/Staf',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Staf Seksi Pemerintahan</a></li>
			
			<?php endif;?>
			<!-- END OF Seksi Pemerintahan -->

			<!-- Seksi Kesejahteraan Sosial -->
			<?php if($this->LoginInfo->Is('Seksi Kesejahteraan Sosial')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Seksi Kesejahteraan Sosial</a></li>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_pegawai/set_mode/Staf',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Staf Seksi Kesejahteraan Sosial</a></li>
			
			<?php endif;?>
			<!-- END OF Seksi Kesejahteraan Sosial -->

			<!-- Seksi Ekonomi Pembangunan -->
			<?php if($this->LoginInfo->Is('Seksi Ekonomi Pembangunan')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Seksi Ekonomi Pembangunan</a></li>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_pegawai/set_mode/Staf',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Staf Seksi Ekonomi Pembangunan</a></li>
			
			<?php endif;?>
			<!-- END OF Seksi Ekonomi Pembangunan -->

			<!-- Seksi Pelayanan Umum -->
			<?php if($this->LoginInfo->Is('Seksi Pelayanan Umum')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Seksi Pelayanan Umum</a></li>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_pegawai/set_mode/Staf',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Staf Seksi Pelayanan Umum</a></li>
			
			<?php endif;?>
			<!-- END OF Seksi Pelayanan Umum -->

			<!-- STAF -->
			<?php if($this->LoginInfo->Is('Staf')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Staf</a></li>
			<?php endif;?>
			<!-- END OF STAF -->

				<!-- STAF -->
			<?php if($this->LoginInfo->Is('Bendahara')):?>
			<li><a href="javascript:;" onclick="setContent('master','aktifitas_saya',this)"><i class="fa fa-eye"></i>&nbsp;Aktifitas Bendahara</a></li>
			<?php endif;?>
			<!-- END OF STAF -->			
			<li>&nbsp;</li>
			<li><a href="javascript:;" onclick="setContent('master','pengguna/edit/<?php echo $this->LoginInfo->GetUserInfo('id_pengguna').'?change_password=true';?>')"><i class="fa fa-key"></i>&nbsp;Ganti Password</a></li>
			<li><a href="<?php echo base_url()?>session/logout"><i class="fa fa-reply"></i>&nbsp;Logout</a></li>
		</ul>
	</div>
	
	<?php if( $this->LoginInfo->Is('Admin') || $this->LoginInfo->Is('Data Entri') || $this->LoginInfo->Is('Cabang')):?>
	
	<?php endif;?>
	<?php if($this->LoginInfo->IsAdmin()):?>
	
	<?php endif ?>
	<!-- <h3><i class="fa fa-cog"></i>&nbsp;App Dev</h3>
	<div>
		<ul class="menu-bar">
			<li><a href="javascript:;" onclick="setContent('appdev','ep',this)"><i class="fa fa-gear"></i>&nbsp;AppDev 1.0</a></li>

		</ul>
	</div> -->

</div>
<!-- END OF ACCORDION -->
</div>
</body>
</html>